package org.kernely.ui.mvp;

/**
 * Interface to implement to be a presenter.
 * You can also use KernelyPresenter abstract class, where main methods are already filled.
 *
 * @param <T> The view associated to the presenter.
 */
public interface IKernelyPresenter<T extends IKernelyView> extends KernelyEventSender{
	
	/**
	 * Set the view associated to the presenter
	 * @param view : the view associated
	 */
	void setView(T view);
	
	/**
	 * Give the presenter's view
	 * @return the view associated
	 */
	IKernelyView getView();
	
	/**
	 * Set the components of the view
	 */
	void bind();
	
	/**
	 * To do some stuff when the IKernelyPresenter is no more visible.
	 * If the IKernelyPresenter was listening for events,
	 * you should use this method when its View is hidden, to unregister.
	 */
	void unset();
}
